﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using YiSha.Util;

namespace YiSha.Entity.Business
{
    /// <summary>
    /// 眼部治疗随访表
    /// </summary>
    [Table("BsEyeFollowUp")]
    public class EyeFollowUpEntity : BaseExtensionEntity
    {

        #region 关联档案


        /// <summary>
        /// 建档时间
        /// </summary>
        [Description("建档时间")]
        [NotMapped]
        public string CreateTime { get; set; }

        /// <summary>
        /// 真实姓名
        /// </summary>
        [Description("真实姓名")]
        [NotMapped]
        public string RealName { get; set; }

        /// <summary>
        /// 性别
        /// </summary>
        [Description("性别")]
        [NotMapped]
        public int Gender { get; set; }

        [NotMapped]
        public string GenderText
        {
            get
            {
                if (Gender == 1)
                {
                    return "男";
                }
                else if (Gender == 2)
                {
                    return "女";
                }
                else
                {
                    return "未填写";
                }
            }
        }


        /// <summary>
        /// 生日
        /// </summary>
        [Description("生日")]
        [NotMapped]
        public DateTime Birthday { get; set; }

        [NotMapped]
        public int Age
        {
            get
            {
                return DateTime.Now.Year - Birthday.Year;
            }
        }

        #endregion



        /// <summary>
        /// 随访日期
        /// </summary>
        [Description("随访日期")]
        public DateTime ThisDate { get; set; }


        /// <summary>
        /// 档案编号
        /// </summary>
        [Description("档案编号")]
        public long PersonId { get; set; }

        [NotMapped]
        public string PersonIdStr
        {
            get
            {
                if (this.PersonId!=0)
                {
                    return this.PersonId.ToString();
                }
                else
                {
                    return null;
                }
            }
        }

        /// <summary>
        /// 处方Id
        /// </summary>
        [Description("处方Id")]
        public long PrescriptionId { get; set; }



        [NotMapped]
        public string PrescriptionIdStr
        {
            get
            {
                if (this.PrescriptionId != 0)
                {
                    return this.PrescriptionId.ToString();
                }
                else
                {
                    return null;
                }
            }
        }



        /// <summary>
        /// 排序
        /// </summary>
        /// <returns></returns>
        public int FollowUpSort { get; set; }

        /// <summary>
        /// 下次随访时间
        /// </summary>
        public DateTime NextFollowUpTime { get; set; }

        #region 左眼

        /// <summary>
        /// 左眼调整前
        /// </summary>
        [Description("左眼调整前")]
        public string EyeLeftBefore { get; set; }

        /// <summary>
        /// 左眼调整后
        /// </summary>
        [Description("左眼调整后")]
        public string EyeLeftAfter { get; set; }

        /// <summary>
        /// 左眼当日增幅
        /// </summary>
        [Description("左眼当日增幅")]
        public string EyeLeftDayGrowthRate { get; set; }

        /// <summary>
        /// 左眼总增幅
        /// </summary>
        [Description("左眼总增幅")]
        public string EyeLeftAllGrowthRate { get; set; }

        #endregion

        #region 右眼

        /// <summary>
        /// 右眼调整前
        /// </summary>
        [Description("右眼调整前")]
        public string EyeRightBefore { get; set; }

        /// <summary>
        /// 右眼调整后
        /// </summary>
        [Description("右眼调整后")]
        public string EyeRightAfter { get; set; }

        /// <summary>
        /// 右眼当日增幅
        /// </summary>
        [Description("右眼当日增幅")]
        public string EyeRightDayGrowthRate { get; set; }

        /// <summary>
        /// 右眼总增幅
        /// </summary>
        [Description("右眼总增幅")]
        public string EyeRightAllGrowthRate { get; set; }

        #endregion


    }

}